<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection" />
		<meta content="emai=no" name="format-detection" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST?>shared/css/shared.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo STATIC_HOST?>coupon/css/list.css" />
		<script type="text/javascript" src="<?php echo STATIC_HOST?>shared/js/zepto-1.1.6.js"></script>
		<script type="text/javascript" src="<?php echo STATIC_HOST?>shared/js/md5.js"></script>
		<title>优惠券</title>
	</head>

	<body>
		<div class="wrapper select">
			<?php if($list):?>
			<ul class="list">
				<?php foreach ($list as $item):?>
				<li class="flex-wrapper flex-align-center" data-href="/sale/order/choosecoupon?coupon_id=<?php echo $item['coupons_id']?>">
					<div class="flex-left">
						<p class="price">&yen;<span><?php echo $item['coupons_money']?></span></p>
						<p class="desc"><?php if($item['coupons_type']==2):?>满<?php echo $item['coupons_full_money']?>元可用<?php endif;?></p>
					</div>
					<div class="flex-1 info">
						<p class="title"><?php echo $item['coupons_name']?> <?php if($item['total'] > 1):?><span class="number"><?php echo $item['total']?>张</span> <?php endif;?></p>
						<p><?php echo date('Y-m-d H:i', strtotime($item['use_start_time']))?> - <?php echo date('Y-m-d H:i', strtotime($item['use_end_time']))?></p>
					</div>
				</li>
				<?php endforeach;?>
			</ul>
			<p class="guide">
				<a data-href="javascript:zsmm.Popup.New($('.popup-guide'));">使用说明</a>
			</p>
			<?php else:?>
			<p class="no-result">
				暂没有可用的优惠券~
			</p>
			<?php endif;?>
			<div class="hide popup-guide">
				<span class="close" data-href="javascript:zsmm.Popup.clear();"><img class="fullScreen" src="<?php echo STATIC_HOST?>coupon/img/i_close.png" /></span>
				<strong>优惠券使用说明</strong>
				<p>1. 单个订单只能使用一张优惠券。</p>
				<p>2. 优惠券金额大于订单应付金额，差额不予退回。</p>
				<a onclick="javascript:zsmm.Popup.clear();">我知道了</a>
			</div>
		</div>
		<script type="text/javascript" src="<?php echo STATIC_HOST?>shared/js/shared.js"></script>

	</body>

</html>